﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Forms;
using System.ComponentModel.Design;
using System.Windows.Forms.Design;
using System.Drawing.Design;
using System.IO;
using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace DamageCalculator.Classes
{
    public class ParsableLogEntry
    {
        [XmlIgnore()]
        DamageCalculator.Classes.GameSettings mParent;

        [XmlAttribute("FormatString")]
        String mFormatString;

        [XmlAttribute("EventType")]
        EventTypes mEType;


        public DamageCalculator.Classes.GameSettings Parent
        {
            get { return this.mParent; }
            set { this.mParent = value; }
        }

        public String FormatString
        {
            get { return this.mFormatString; }
            set { this.mFormatString = value; }
        }

        public EventTypes Event
        {
            get { return this.mEType; }
            set { this.mEType = value; }
        }

        [Serializable]
        public enum FormatTags
        {
            DateTime,
            GivingUnit,
            RecievingUnit,
            Ammount,
        }

        [Serializable]
        public enum EventTypes
        {
            GiveHeal,
            GiveDamage,
            GetHeal,
            GetDamage,
            CriticalGiveHeal,
            CriticalGiveDamage,
            CriticalGetHeal,
            CriticalGetDamage,
            GetXp,
            NonHPEffect,
            NonHPEffectFades,
            DeathTime,
        }

        public ParsableLogEntry(DamageCalculator.Classes.GameSettings owner)
        {
            this.mParent = owner;
        }

        public ParsableLogEntry(DamageCalculator.Classes.GameSettings owner, String FormatString, EventTypes EType)
            : this(owner)
        {
            this.mFormatString = FormatString;
            this.mEType = EType;
        }

        public ParsableLogEntry(String FormatString, EventTypes Etype)
        {
            this.mFormatString = FormatString;
            this.mEType = Etype;
        }
        public ParsableLogEntry()
        {
            //Do Nothing
        }

        public override string ToString()
        {
            return this.mEType.ToString() + ": " + this.mFormatString;
        }
    }
}
